import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import '../node_modules/element-plus/theme-chalk/index.css'
import router from './router/router'
//element-plus 的中文化
import locale from '../node_modules/element-plus/lib/locale/lang/zh-cn'  //element-plus
import NProgress from 'nprogress'
import '../node_modules/nprogress/nprogress.css' // progress bar style

//设置网页标题
router.beforeEach((to, from, next) => {
    /* 路由发生变化修改页面title */
    if (to.meta.title) {
        document.title = to.meta.title+"--网站名称"
    }
    NProgress.start();
    next()
})
router.afterEach(() => {
    NProgress.done();
});


//启动app
const app = createApp(App)
app.use(ElementPlus,{locale})
app.use(router)
app.mount('#app')